package com.careerraiser.xtra.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class TestRunnable {

	public static void main(String[] args) {
		MyRunnable run1 = new MyRunnable(1000,"run1");
		MyRunnable run2 = new MyRunnable(1000,"run2");
		MyRunnable run3 = new MyRunnable(1000,"run3");
		MyRunnable run4 = new MyRunnable(1000,"run4");
		MyRunnable run5 = new MyRunnable(1000,"run5");
		MyRunnable run6 = new MyRunnable(1000,"run6");
		MyRunnable run7 = new MyRunnable(1000,"run7");
		MyRunnable run8 = new MyRunnable(1000,"run8");
		MyRunnable run9 = new MyRunnable(1000,"run9");
		MyRunnable run10 = new MyRunnable(1000,"run10");

		ExecutorService exec = Executors.newFixedThreadPool(10);
		System.out.println("before calling runnable");
		exec.execute(run1);
		exec.execute(run2);
		exec.execute(run3);
		exec.execute(run4);
		exec.execute(run5);
		exec.execute(run6);
		exec.execute(run7);
		exec.execute(run8);
		exec.execute(run9);
		exec.execute(run10);
		System.out.println("after calling runnable");

	}

}
